<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <el-menu default-active='active' mode='horizontal' class='menu-unit'>
          <el-menu-item v-for='item in Container2' :index="'商机管理'===item.name?'active':'default'">
            <el-link @click="gotoMenu(item.url)" :type="'商机管理'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
        <table cellpadding="4" cellspacing="0" border="0" width="100%">
          <tr>
            <td class="containerBack">
              <el-form ref="form" :model="s_predict" :rules="rules" label-width="100px" id="mvcfm">
                <div class="form-unit">
                  <span class="mvc-title-left"> 商机明细 </span>
                </div>
                <div>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="客户" prop="">
                        {{s_predict.client_name}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="主题" prop="predict_theme">
                        {{s_predict.predict_theme}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="商机描述" prop="predict_des">
                        {{s_predict.predict_des}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="访问类型" prop="">
                        {{empty}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="经理" prop="">
                        {{s_predict.person_name}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
                <el-button @click="gotoPage('/crm/sale/contacts/ContactsBusinessOpportAssembly?'+vueparams+'')" type='primary' size="mini">添加组件</el-button>
                <div class="form-unit">
                  <span class="mvc-title-left"> 组成 </span>
                </div>
                <el-table :data="s_part">
                  <el-table-column label="操作" align="center" width='100' type=''>
                    <template slot-scope="scope">
                      <el-dropdown trigger="click">
                        <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
                        <el-dropdown-menu slot="dropdown">
                          <el-dropdown-item>
                            <el-link @click="gotoPage('/crm/sale/contacts/ContactsBusinessOpportAssemblyDet?CMID4='+scope.row.part_id+''+vueparams+'')">查看明细</el-link>
                          </el-dropdown-item>
                          <el-dropdown-item>
                            <el-link @click="gotoPage('/crm/sale/contacts/ContactsBusinessOpportDet?CMID4='+scope.row.part_id+''+vueparams+'')">删除</el-link>
                          </el-dropdown-item>
                        </el-dropdown-menu>
                      </el-dropdown>
                    </template>
                  </el-table-column>
                  <el-table-column label="组件" prop="part_id">
                    <template slot-scope="scope">
                      <el-link @click="gotoPage('/crm/sale/contacts/ContactsBusinessOpportAssemblyDet?CMID4='+scope.row.part_id+''+vueparams+'')" type='primary'>{{scope.row.part_des}}</el-link>
                    </template>
                  </el-table-column>
                  <el-table-column label="关闭可能性" prop="part_clised">
                  </el-table-column>
                  <el-table-column label="猜测金额" prop="part_des">
                  </el-table-column>
                  <el-table-column label="当前状态" prop="">
                  </el-table-column>
                  <el-table-column label="估计关闭日期" prop="part_closedate">
                  </el-table-column>
                  <el-table-column label="归属于" prop="">
                    <template slot-scope="scope">
                      <el-link @click="gotoPage(''+vueparams+'')" type='primary'>{{scope.row['']}}</el-link>
                    </template>
                  </el-table-column>
                </el-table>
              </el-form>
            </td>
          </tr>
        </table>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'联系人'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'ContactsBusinessOpportDet',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_predict: {
          client_name: null,
          predict_theme: null,
          predict_des: null,
          person_name: null,
        },
        s_part: [],
        loading: false,
        Container: null,
        Container2: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "80299289AF2443B18EA545A4C0C37170",
        name: "客户管理右菜单",
        selected: "联系人"
      }, 'Container', this.vueparams);
      this.loadContainerMenu({
        pid: "14ED91704E794C43A973E8BEFF724C15",
        name: "客户联系人右菜单",
        selected: "商机管理"
      }, 'Container2', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/crm/sale/contacts/ContactsBusinessOpport/contactsBusinessOpportDet?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
    },
  }
</script>
